package thread.demo01;

import lombok.AllArgsConstructor;

/**
 * 实现runnable 接口
 */
@AllArgsConstructor
public class TestRunnable01 implements Runnable {
    private String url;
    private String name;

    @Override
    public void run() {
        // 方法线程体
        downLoader.downLoader(url, name);
        System.out.println("下载了文件名为：" + name);
    }

    /*主方法  主线程*/
    public static void main(String[] args) {
        /*创建runnbale 接口的实现类对象*/

        new Thread(new TestRunnable01("https://ss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/0b46f21fbe096b636678ddd40c338744eaf8acd5.jpg","1.jpg")).start();
        new Thread(new TestRunnable01("https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2390255124,2789605295&fm=26&gp=0.jpg","2.jpg")).start();
        new Thread(new TestRunnable01("https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2248364240,810524291&fm=26&gp=0.jpg","3.jpg")).start();

    }
}
